/**
 * 
 */
package name.marz.to.go.btree.ui.swing;

import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 * @author masaru-gotou
 *
 */
public class SelectControlPanel extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JTextField key;
	private JButton btn;
	private JLabel result;
	
	public SelectControlPanel() {
//		setLayout(new BorderLayout());
		key = new JTextField(5);
		key.setToolTipText("key");
		btn = new JButton("Select");
		btn.setToolTipText("Scan Tree");
		result = new JLabel();
		
		add(BorderLayout.WEST,key);
		add(BorderLayout.CENTER,btn);
		add(BorderLayout.SOUTH,result);
	}
	public String getKey() {
		return key.getText();
	}
	public void addSelectActionListener(ActionListener l) {
		btn.addActionListener(l);
	}
	public void setResult(String text) {
		result.setText("result="+text);
	}
	public void setSelectButtonEnabled(boolean b) {
		btn.setEnabled(b);
	}
	                                              

}
